--- /dev/null
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * st-scroll-view-private.h: Private StSrollView methods
+ *
+ * Copyright 2023 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU Lesser General Public License,
+ * version 2.1, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "st-scroll-view.h"
+
+G_BEGIN_DECLS
+
+void st_scroll_view_get_bar_offsets (StScrollView *scroll_view,
+ float *hoffset,
+ float *voffset);
+
+G_END_DECLS
#include "st-enum-types.h"
#include "st-private.h"
-#include "st-scroll-view.h"
+#include "st-scroll-view-private.h"
#include "st-scroll-bar.h"
#include "st-scrollable.h"
#include "st-scroll-view-fade.h"
g_object_thaw_notify ((GObject *) scroll);
}
+
+void
+st_scroll_view_get_bar_offsets (StScrollView *scroll,
+ float *hoffset,
+ float *voffset)
+{
+ StScrollViewPrivate *priv;
+
+ g_return_if_fail (ST_IS_SCROLL_VIEW (scroll));
+
+ priv = st_scroll_view_get_instance_private (scroll);
+
+ if (hoffset)
+ {
+ *hoffset = priv->vscrollbar_visible ? clutter_actor_get_width (priv->vscroll)
+ : 0.;
+ }
+
+ if (voffset)
+ {
+ *voffset = priv->hscrollbar_visible ? clutter_actor_get_height (priv->hscroll)
+ : 0.;
+ }
+}